package lab02.test11;

public class Rectangle implements Printx {

    double length;
    double width;


    double area() {
        return length * width;
    }

    double perimeter() {

        return 2 * length + 2 * width;
    }

    @Override
    public void printMyWay() {

        System.out.println("长：" + length + "\n宽：" + width
                + "\n周长：" + perimeter() + "\n面积：" + area());

    }
}
